//
//  BYProductDetailsCell.m
//  OCDemo
//
//  Created by zhumuzhi on 2022/1/5.
//

#import "BYProductDetailsCell.h"
#import "BYProductDetailsModel.h"

@interface BYProductDetailsCell ()

@property (nonatomic, strong) UILabel *title;

@property (nonatomic, strong) UILabel *details;

@end

@implementation BYProductDetailsCell

#pragma mark - CellHeight
+ (CGFloat)cellHeightWithModel:(BYProductDetailsModel *)model {
    return 200;
}


#pragma mark - SetData
- (void)setModel:(BYProductDetailsModel *)model {
    _model = model;
 
    self.title.text = @"详情图片";
    
}

#pragma mark - Init
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self) {
        [self.contentView addSubview:self.title];
        [self.contentView addSubview:self.details];
    }
    return self;
}


- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(kAutoWithSize(10));
        make.left.equalTo(self.contentView).offset(kAutoWithSize(10));
        make.width.mas_equalTo(kAutoWithSize(100));
    }];
    
    [self.details mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(kAutoWithSize(10));
        make.left.equalTo(self.title.mas_right).offset(kAutoWithSize(5));
        make.right.equalTo(self.contentView).offset(-kAutoWithSize(10));
    }];
    
}

#pragma mark - LazyGet

- (UILabel *)title {
    if (!_title) {
        _title = [[UILabel alloc] init];
        _title.font = MZFont(14);
    }
    return _title;
}

- (UILabel *)details {
    if (_details) {
        _details = [[UILabel alloc] init];
        _details.font = MZFont(14);
    }
    return _details;
}



@end
